import 'dart:convert';


class VersionEntity {
  // int id;
  int modelId;
  String versionCode;
  // String versionName;
  // String? description;
  // String? remark;
  double? price;

  VersionEntity({
    // required this.id,
    required this.modelId,
    required this.versionCode,
    // required this.versionName,
    // required this.description,
    // required this.remark,
    required this.price,
  });

  factory VersionEntity.fromJson(Map<String, dynamic> json) => VersionEntity(
        // id: json["id"],
        modelId: json["modelId"],
        versionCode: json["versionCode"],
        // versionName: json["versionName"],
        // description: json["description"],
        // remark: json["remark"],
        price: json["price"],
      );

  Map<String, dynamic> toJson() => {
        // "id": id,
        "modelId": modelId,
        "versionCode": versionCode,
        // "versionName": versionName,
        // "description": description,
        // "remark": remark,
        "price": price,
      };

  VersionEntity modelInfoEntityFromJson(String str) =>
      VersionEntity.fromJson(json.decode(str));

  String modelInfoEntityToJson(VersionEntity data) =>
      json.encode(data.toJson());

  static List<Map> exchangeLabelList(List<VersionEntity> entitys) {
    List<Map> list = [];
    for (VersionEntity entity in entitys) {

      list.add({"label": entity.versionCode, "value": entity.versionCode,"price":entity.price});
    }
    return list;
  }
}
